-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
d.mon: Delegate rendering to wx monitors #3500
Conversation
Unlike #3482, with this PR, no changes are needed in display modules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I'm missing some details here, this looks like a good and appropriate solution to the problem. It does special things for d.mon wx* which is where the issue is.
@landam It would be good if you can give this at least a quick look. |
My comments on the explanation:
Seems like intended behavior.
This is the part not clear to me. Why is the touch needed? The rendering happens based on the cmd file (not map file, no?) and than the rendering actually modifies the map file, so why do we need to touch it beforehand?
Makes sense. The wxGUI code does its own rendering in the g.gui case, so doing it for the
Seems like intended behavior.
That sounds clear and straightforward. |
I suggest closing the |
Yes
This is only my guess; the original developer should know better. Maybe, the monitor code assumes that new layers are only added through the command line, which will create first images (map files) from the terminal (no more with this PR, only empty images) and it thinks checking the
If there is a better way to let wxGUI know about commands from the terminal. To me, Just one thing. If someone more familiar with wxGUI could modify it to create missing map files, the touching line would not be necessary.
Yes
Great! |
d9ff3e1
to
8021f2e
Compare
Is this PR ready or there was still some missing pieces? |
This PR is ready to go with #3484. |
How to test this PR and #3484: d.mon start=wx0
d.rast elevation
# zoom in
d.redraw
# 1. see how d.redraw *with* #3484 draws the full extent
# because rendering is done from the command line and
# only the monitor knows the current extent
# 2. pan and you'll see the previously zoomed-in and panned rendering Now, with both this PR and #3484, d.mon start=wx0
d.rast elevation
# zoom in
d.redraw
# 1. see how d.redraw with this PR *and* #3484 draws the correct extent
# because it delegates rendering to the monitor, which knows the current extent |
I'm not set up to be able to test this out. (I don't have a standard Linux desktop/gui installation, I only ever use Linux terminal only, or through WSL that even with now gui support, if I would see a UI problem it probably wouldn't be this PR's fault). If someone is able to find something that would change the contents of these two PRs, they should. Otherwise, they already had 2 months to object themselves. For these two I don't see any problems from what I see in the diffs, and from what I know. The problems would be on what I don't know (ie, impacts on parts of the code that I haven't read yet). I would be almost ready to take your word for it, and simply have these changes merged in main for longer instead, in case any problem shows up. |
Off-topic: I wanted to quickly check the new code again since I approved this in the past, but the rebase (force-push) prevents GitHub from showing changes since the last review. So, I guess that's a major drawback of rebase in a PR branch. |
I tried to locally patch my main version and test but this PR is apparently out of sync:
Can it please be updated first (I hesitate to use the "Update branch" button)? |
…created by display driver; they are all blank
8021f2e
to
3edba7b
Compare
@neteler Please try it again (now #3727 and #3500): $ git clone git@github.com:OSGeo/grass.git
$ cd grass
$ wget https://github.com/OSGeo/grass/pull/3727.diff
$ wget https://github.com/OSGeo/grass/pull/3500.diff
$ patch -p1 < 3727.diff
patching file display/Makefile
patching file display/d.redraw/Makefile
patching file display/d.redraw/d.redraw.html
patching file display/d.redraw/main.c
patching file scripts/Makefile
patching file scripts/d.redraw/Makefile
patching file scripts/d.redraw/d.redraw.html
patching file scripts/d.redraw/d.redraw.py
$ patch -p1 < 3500.diff
patching file display/d.mon/render_cmd.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is another attempt to address #3481. It should replace
D_open_driver()
returns-1
ifGRASS_REGION
is not defined from the terminal #3482How it works:
d.mon start=wx0
D_open_setup()
from the module spawns the monitor'srender.py
and exitsrender.py
touches a temp map file for the wx monitor so the monitor can force rendering non-existing layers; without this empty file, the monitor won't render them (Layer.IsRendered()
andRenderMapMgr._checkRenderedSizes()
ingui/wxpython/core/render.py
)render.py
doesn'trender()
for the wx monitor because the monitor is watching thecmd
file and will render any new layers; existing layers won't be re-rendered (exists
inGetLayersFromCmdFile()
ingui/wxpython/mapdisp/main.py
render.py
adds the new command line to thecmd
filecmd
file from step 6 and calls the display module for actual rendering (RenderLayerMgr.Render()
ingui/wxpython/core/render.py
)A display module is called twice by the user from the terminal and by the wx monitor or
render.py
for non-wx monitors.